package com.wxl.common.room.dao

import androidx.room.*
import com.wxl.common.room.entity.LogEntity

@Dao
interface OperateLogDao {

    @Transaction
    @Insert(onConflict= OnConflictStrategy.REPLACE )
    fun insert(vararg entity: LogEntity)

    @Transaction
    @Delete
    fun delete(vararg entity: LogEntity)

    @Transaction
    @Update
    fun update(vararg entity: LogEntity)

    @Transaction
    @Query("select * from operate")
    fun query() : List<LogEntity>

    @Transaction
    @Query("SELECT * FROM operate WHERE operateId > 50 limit 1;")
    fun queryEnd() : List<LogEntity>


    @Transaction
    @Query("select count(*) from operate")
    fun count() : Int

}